package com.atguigu.rpc;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.ipc.RPC;

import static java.lang.System.*;

/**
 * @description: 服务端实现通信接口
 * @time: 2021/3/26 10:12
 * @author: baojinlong
 **/
public class NnServer implements RpcProtocol {
    public static void main(String[] args) throws Exception {
        // 启动服务
        RPC.Server server = new RPC.Builder(new Configuration())
                .setPort(8888)
                .setProtocol(RpcProtocol.class)
                .setInstance(new NnServer())
                .build();
        out.println("服务器开始工作");
        server.start();
    }

    @Override
    public void mkDirs(String path) {
        out.println("服务器接收到了客户端请求" + path);
    }
}
